package com.tsll.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName staff
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Staff implements Serializable {
    private  Integer staffshu;

    private Integer newdeptid;
    /**
     * 
     */
    private Integer id;

    /**
     * 员工id
     */
    private Integer staffid;

    /**
     * 员工姓名
     */
    private String staffname;

    /**
     * 员工密码
     */
    private String password;

    /**
     * 身份证号
     */
    private String idcard;

    /**
     * 家庭地址
     */
    private String address;

    /**
     * 员工电话
     */
    private String phone;

    /**
     * 入职时间
     */
    @DateTimeFormat(pattern = "yyyy-MMM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date entrytime;

    /**
     * 离职时间
     */
    private Date leavetime;

    /**
     * 在职状态
     */
    private Integer state;

    /**
     * 角色id
     */
    private Integer roleid;

    /**
     * 部门id
     */
    private Integer deptid;
    private Staffsal staffsal;
     private  Integer sal_id;


    public Integer getSal_id() {
        return sal_id;
    }

    public void setSal_id(Integer sal_id) {
        this.sal_id = sal_id;
    }

    public Staffsal getStaffsal() {
        return staffsal;
    }

    public void setStaffsal(Staffsal staffsal) {
        this.staffsal = staffsal;
    }

    /**
     * 头像
     */
    private String url;
    private Role role;

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    /**
     * 所在部门
     */
    private  Department department;

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    private static final long serialVersionUID = 1L;

    public Integer getNewdeptid() {
        return newdeptid;
    }

    public void setNewdeptid(Integer newdeptid) {
        this.newdeptid = newdeptid;
    }

    /**
     * 
     */
    public Integer getId() {
        return id;
    }

    /**
     * 
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 员工id
     */
    public Integer getStaffid() {
        return staffid;
    }

    /**
     * 员工id
     */
    public void setStaffid(Integer staffid) {
        this.staffid = staffid;
    }

    /**
     * 员工姓名
     */
    public String getStaffname() {
        return staffname;
    }

    /**
     * 员工姓名
     */
    public void setStaffname(String staffname) {
        this.staffname = staffname;
    }

    /**
     * 员工密码
     */
    public String getPassword() {
        return password;
    }

    /**
     * 员工密码
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * 身份证号
     */
    public String getIdcard() {
        return idcard;
    }

    /**
     * 身份证号
     */
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }

    /**
     * 家庭地址
     */
    public String getAddress() {
        return address;
    }

    /**
     * 家庭地址
     */
    public void setAddress(String address) {
        this.address = address;
    }

    /**
     * 员工电话
     */
    public String getPhone() {
        return phone;
    }

    /**
     * 员工电话
     */
    public void setPhone(String phone) {
        this.phone = phone;
    }

    /**
     * 入职时间
     */
    public Date getEntrytime() {
        return entrytime;
    }

    /**
     * 入职时间
     */
    public void setEntrytime(Date entrytime) {
        this.entrytime = entrytime;
    }

    /**
     * 离职时间
     */
    public Date getLeavetime() {
        return leavetime;
    }

    /**
     * 离职时间
     */
    public void setLeavetime(Date leavetime) {
        this.leavetime = leavetime;
    }

    /**
     * 在职状态
     */
    public Integer getState() {
        return state;
    }

    /**
     * 在职状态
     */
    public void setState(Integer state) {
        this.state = state;
    }

    /**
     * 角色id
     */
    public Integer getRoleid() {
        return roleid;
    }

    /**
     * 角色id
     */
    public void setRoleid(Integer roleid) {
        this.roleid = roleid;
    }

    /**
     * 部门id
     */
    public Integer getDeptid() {
        return deptid;
    }

    /**
     * 部门id
     */
    public void setDeptid(Integer deptid) {
        this.deptid = deptid;
    }

    /**
     * 头像
     */
    public String getUrl() {
        return url;
    }

    /**
     * 头像
     */
    public void setUrl(String url) {
        this.url = url;
    }


    public Integer getStaffshu() {
        return staffshu;
    }

    public void setStaffshu(Integer staffshu) {
        this.staffshu = staffshu;
    }



    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Staff other = (Staff) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStaffid() == null ? other.getStaffid() == null : this.getStaffid().equals(other.getStaffid()))
            && (this.getStaffname() == null ? other.getStaffname() == null : this.getStaffname().equals(other.getStaffname()))
            && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
            && (this.getIdcard() == null ? other.getIdcard() == null : this.getIdcard().equals(other.getIdcard()))
            && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
            && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
            && (this.getEntrytime() == null ? other.getEntrytime() == null : this.getEntrytime().equals(other.getEntrytime()))
            && (this.getLeavetime() == null ? other.getLeavetime() == null : this.getLeavetime().equals(other.getLeavetime()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getRoleid() == null ? other.getRoleid() == null : this.getRoleid().equals(other.getRoleid()))
            && (this.getDeptid() == null ? other.getDeptid() == null : this.getDeptid().equals(other.getDeptid()))
            && (this.getUrl() == null ? other.getUrl() == null : this.getUrl().equals(other.getUrl()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStaffid() == null) ? 0 : getStaffid().hashCode());
        result = prime * result + ((getStaffname() == null) ? 0 : getStaffname().hashCode());
        result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
        result = prime * result + ((getIdcard() == null) ? 0 : getIdcard().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
        result = prime * result + ((getEntrytime() == null) ? 0 : getEntrytime().hashCode());
        result = prime * result + ((getLeavetime() == null) ? 0 : getLeavetime().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getRoleid() == null) ? 0 : getRoleid().hashCode());
        result = prime * result + ((getDeptid() == null) ? 0 : getDeptid().hashCode());
        result = prime * result + ((getUrl() == null) ? 0 : getUrl().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", staffid=").append(staffid);
        sb.append(", staffname=").append(staffname);
        sb.append(", password=").append(password);
        sb.append(", idcard=").append(idcard);
        sb.append(", address=").append(address);
        sb.append(", phone=").append(phone);
        sb.append(", entrytime=").append(entrytime);
        sb.append(", leavetime=").append(leavetime);
        sb.append(", state=").append(state);
        sb.append(", roleid=").append(roleid);
        sb.append(", deptid=").append(deptid);
        sb.append(", url=").append(url);
        sb.append(",dept=").append(department);
        sb.append(",oidDeptId=").append(newdeptid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}